package cloud.coder.remote.config;

import java.util.HashMap;
import java.util.Map;

public class Config {
    /**
     * service addresses.
     */
    public static String BACKEND_SERVICE = "localhost:7077";

    /**
     * Authentication active is based on backend setting, see application.yml for more details. For most scenarios,
     * this needs backend extensions, only basic match auth provided in default implementation.
     */
    public static String AUTHENTICATION = "tianhe";

    /**
     * Force reconnection period of grpc, based on grpc_channel_check_interval. If count of check grpc channel
     * status more than this number. The channel check will call channel.getState(true) to requestConnection.
     */
    public static long FORCE_RECONNECTION_PERIOD = 1;

    /**
     * grpc channel status check interval
     */
    public static long GRPC_CHANNEL_CHECK_INTERVAL = 30L;
    /**
     * The period in which the agent report a heartbeat to the backend.
     */
    public static long HEARTBEAT_PERIOD = 10;

    /**
     * How long grpc client will timeout in sending data to upstream.
     */
    public static int GRPC_UPSTREAM_TIMEOUT = 30;

    /**
     * The client sends the instance properties to the backend every `heartbeat_period * properties_report_period_factor` seconds
     */
    public static int PROPERTIES_REPORT_PERIOD_FACTOR = 3;

    /**
     * service instance properties e.g. client.instance_properties[language]=java
     */
    public static Map<String, String> INSTANCE_PROPERTIES = new HashMap<>();

    /**
     * The identifier of the instance
     */
    public volatile static String INSTANCE_NAME = "";
    /**
     * Service name is showed in server-ui. Suggestion: set a unique name for each service, service instance
     * nodes share the same code
     */
    public static String SERVICE_NAME = "";

    /**
     * Limit the length of the ipv4 list size.
     */
    public static int IPV4_LIST_SIZE = 10;
}
